<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<html>
<head>
<title>澳斯浪廷会员平台</title>
<link href="<c:url value='/resources/css/css.css'/>" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<c:url value='/resources/js/jquery-1.7.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/js/validate.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/js/mask.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/js/MathUtil.js'/>"></script>
</head>
<body leftmargin="0">
<div class="main">
<div class="width_l">
    <iframe src="menu.action" frameborder="0" width="250" height="100%" class="menu"></iframe>
</div>    
    <div class="right">
    <div class="width_r">
        <div class="menu_r">
            <ul>
                <li><a href="index.action">首页</a></li>
                <li><a href="information.action">消息</a></li>
                <li><a href="notice.action">公告中心</a></li>
                <li><a href="news.action">新闻中心</a></li>
                <li><a href="inbox.action">收件箱</a></li>
                <li><a href="mail.action">写邮件</a></li>
                <li><a href="sent.action">已发送</a></li>
                <li><a href="${ctx}/exit.action">安全退出</a></li> 
            </ul>
        </div>
        <div class="news_top"><img src="<c:url value='/resources/images/top.jpg'/>" /></div>
        <div class="news">
          <h4>激活豆中心</h4>
          <div class="hz">激活豆余额： ${userAccount.activMoney } </div>
          <input type="hidden" value="${userAccount.activMoney}" id="activMoney"/>
          <form method="post" id="apply">
          <div class="zz">
            <h6>激活豆申请</h6>　　　
              申请金额 ：<input name="applyAmount" type="text" class="text" size="16" id="applyAmount"/> .${randTwo}　　　
              <input name="randTwo" type="hidden" id="" value="${randTwo}"/>
              三级支付密码：<input name="thirdPassword" type="password" class="text" size="16" id="thirdPassword"/> 
          </div>
          </form>
          <div class="tijiao"><img onclick="doApplyActivity();" src="<c:url value='/resources/images/tijiao.jpg'/>" /></div>
        	<s:action name="activitylist" executeResult="true">
        	</s:action>
        </div>
        <div class="news_down"><img src="<c:url value='/resources/images/down.jpg'/>" /></div>
    </div>
    </div>
</div>

</body>
</html>
<script type="text/javascript">
function doApplyActivity(){
	$.ajaxSetup({cache:false});
	var checkFlg = true;
	checkFlg = checkFlg && validateEmpty_jquery("申请金额 ", "applyAmount");
	checkFlg = checkFlg && validateNumber_jquery("申请金额 ", "applyAmount");
	if(dcmSub($("#applyAmount").val(),3000)<0){
		alert("申请金额不能小于3000");
		return ;
	}
	checkFlg = checkFlg && validateEmpty_jquery("三级支付密码", "thirdPassword");
	//checkFlg = checkFlg && false;
	$.ajax({
		type:'POST',
		url: "${ctx}/chkTidPwd.action",
		data: "thirdPassword="+$("#thirdPassword").val(),
		dataType:"html",
        async:false,  // 设置同步方式
        cache:false,
		success: function(data,status){
			if($.trim(data)!=''){
				setValidateErrorStyle_jquery($("#thirdPassword"));
				alert(data);
				checkFlg = checkFlg && false;
			}
		},
		error: function(data,status,e){
			alert(e.name);
		}
	});
	if ( !checkFlg ) return false;
    if (checkFlg) {
    	//var data = $("#othermember").formSerialize();
    	//document.forms[0].action = "${ctx}/doactivity.action";
        //document.forms[0].submit();
        var data = $("#apply").serialize();
        $(document).mask("系统处理中，请稍后......");
        jQuery.ajax({
			url: "${ctx}/doactivity.action",
			type: "post",
			dataType:"html",
			data:data,
			async:false,
			success: function(jsondata){
				alert(jsondata);
				window.location.href = "${ctx}/activity.action";
			},
			error: function(XMLHttpRequest, textStatus, errorThrown) {
		    }
		});
    }
}
</script>